package com.jjs.jcenterdemo.adapterhelper;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jjs.jcenterdemo.R;
import com.white.commonlib.engine.img.GlideRoundTransform;

import java.util.List;

/**
 * Created by ytf on 2018/3/24 024.
 * Description:
 */

public class QquTopAdapter extends BaseQuickAdapter<ListBean.SingleImgBean, BaseViewHolder>
{
    public QquTopAdapter(int layoutResId, @Nullable List<ListBean.SingleImgBean> data)
    {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ListBean.SingleImgBean item)
    {
        ImageView cover = helper.getView(R.id.cover);
        ImageView head = helper.getView(R.id.head_img);
        Glide.with(mContext)
                .load(item.img)
                .transform(new GlideRoundTransform(mContext, 8, GlideRoundTransform.TYPE_TOP_ONLY))
                .into(cover);
        Glide.with(mContext)
                .load(item.img)
                .into(head);
    }
}
